<template>
    <div style="padding: 10px">
      <el-row>
        <el-col :span="12" style="height: 400px">
          <v-chart class="chart" :option="pieOption" />
        </el-col>
        <el-col :span="12" style="height: 400px">
          <v-chart class="chart" :option="lineOption" />
        </el-col>
      </el-row>
    </div>
</template>
<script>
export default {
  name: 'About',
  data () {
    return {
      pieOption: {
        title: {
          text: '用户性别统计',
          left: 'center'
        },
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          data: ['男', '女', '未知']
        },
        series: [
          {
            name: '网站用户性别信息',
            type: 'pie',
            radius: '55%',
            center: ['50%', '60%'],
            data: [
              { value: 335, name: '男' },
              { value: 310, name: '女' },
              { value: 234, name: '未知' }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      },
      lineOption: {
        title: {
          text: '电影评分统计',
          left: 'center'
        },
        tooltip: {
          trigger: 'item'
        },
        xAxis: {
          type: 'category',
          data: ['2分以下', '2-4分', '4-6分', '6-8分', '8分以上']
        },
        yAxis: {
          type: 'value'
        },
        series: [{
          data: [120, 200, 150, 80, 70],
          type: 'bar'
        }]
      }
    }
  }
}
</script>
